Skip to content

fix: suppress JSONDtypeWarning in Anywidget mode and clean up progress output#2441

Merged
shuoweil merged 37 commits intomainfrom
shuowei-anywidget-disable-warning
Feb 7, 2026
Merged

fix: suppress JSONDtypeWarning in Anywidget mode and clean up progress output#2441
shuoweil merged 37 commits intomainfrom
shuowei-anywidget-disable-warning

Conversation

@shuoweil
Copy link
Contributor

@shuoweil shuoweil commented Feb 6, 2026

This PR improves the user experience when using the interactive anywidget display mode (bpd.options.display.repr_mode = "anywidget") by reducing console noise.

Verified at:
vs code notebook: screen/ACCJRLwyThciMk8
colab notebook: screen/BhNxzpvckYg9Wp8

Fixes #<482120359> 🦕

@shuoweil shuoweil requested review from a team as code owners February 6, 2026 18:31
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Feb 6, 2026
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Feb 6, 2026
@shuoweil shuoweil requested review from sycai and tswast February 6, 2026 18:31
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 6, 2026
@shuoweil shuoweil marked this pull request as draft February 6, 2026 21:11
Copy link
Contributor

@sycai sycai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add a test, assuming that it would not be forbiddingly hard?

elif progress_bar == "terminal":
if isinstance(event, bigframes.core.events.ExecutionStarted):
print("Starting execution.")
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's add a comment on why no action is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I have added a comment explaining that we are skipping it to reduce noise in the terminal.

Comment on lines 118 to 125
with warnings.catch_warnings():
warnings.simplefilter("ignore", bigframes.exceptions.JSONDtypeWarning)
warnings.simplefilter("ignore", category=FutureWarning)
self.orderable_columns = [
str(col_name)
for col_name, dtype in dataframe.dtypes.items()
if dtypes.is_orderable(dtype)
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No action needed) It seems this constructor is getting way more complicated than necessary. We may need a refactoring some time in the future. Given the tight timeline we have at the moment, this change can be merged as-is in this PR

Copy link
Contributor Author

@shuoweil shuoweil Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk of code has been refactored for better readability.

@shuoweil shuoweil requested a review from sycai February 6, 2026 22:49
@shuoweil shuoweil marked this pull request as ready for review February 7, 2026 00:02
@shuoweil shuoweil assigned shuoweil and unassigned ericfe-google Feb 7, 2026
@shuoweil shuoweil enabled auto-merge (squash) February 7, 2026 00:31
@shuoweil shuoweil merged commit e0d185a into main Feb 7, 2026
20 of 24 checks passed
@shuoweil shuoweil deleted the shuowei-anywidget-disable-warning branch February 7, 2026 01:14
shuoweil added a commit that referenced this pull request Feb 7, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:e7cc6823efb073a8a26e7cefdd869f12ec228abfbd2a44aa9a7eacc284023677
<details><summary>bigframes: 2.35.0</summary>

##
[2.35.0](v2.34.0...v2.35.0)
(2026-02-07)

### Features

* Add bigframes.pandas.col with basic operators (#2405)
([1274167](12741677))

* remove redundant &#34;started.&#34; messages from progress output
(#2440)
([2017cc2](2017cc2f))

* add bigframe.bigquery.load_data function (#2426)
([4b0f13b](4b0f13b2))

* Disable progress bars in Anywidget mode (#2444)
([4e2689a](4e2689a1))

* add bigquery.ai.generate_text function (#2433)
([5bd0029](5bd0029a))

* Disable progress bars in Anywidget mode to reduce notebook clutter
(#2437)
([853240d](853240da))

* Add a bigframes cell magic for ipython (#2395)
([e6de52d](e6de52de))

* add `bigframes.bigquery.ai.generate_embedding` (#2343)
([e91536c](e91536c8))

### Bug Fixes

* always display the results in the `%%bqsql` cell magics output (#2439)
([2d973b5](2d973b54))

* exlcude gcsfs 2026.2.0 (#2445)
([311de31](311de31e))

* suppress JSONDtypeWarning in Anywidget mode and clean up progress
output (#2441)
([e0d185a](e0d185ad))

### Documentation

* fix cast method shown on public docs (#2436)
([ad0f33c](ad0f33c6))

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants